package com.example.hibernatevalidator.entity;


import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

@Data
public class Person {

    @NotNull(message = "name不能为空")
    @Size(min = 2,max = 6,message = "名字的字符在2个和6个之间")
    private String name;

    @NotNull(message = "age不能为空")
    @Min(value = 0,message = "年龄不能为负数")
    private int age;
}
